<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <title>后盾人</title>
  </head>
  <body></body>
  <script>
    //lastIndex
    let hd = "houdunren";
    // console.log(hd.match(/\w/g));
    let reg = /\w/g;
    console.log(reg.lastIndex);
    console.log(reg.exec(hd));
    console.log(reg.lastIndex);
    console.log(reg.exec(hd));
    // while ((res = reg.exec(hd))) {
    //   console.log(res);
    // }
  </script>
</html>
